<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Lorem MoonのStory - あなたはしばらくここにいるだけですが、私の人生を変えました</title><meta name="keywords" content="Hexo, blog, Lorem Moon, github page"><meta name="author" content="Lorem Moon"><meta name="copyright" content="Lorem Moon"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="即已成过往，便随它而去吧。">
<meta property="og:type" content="website">
<meta property="og:title" content="Lorem MoonのStory">
<meta property="og:url" content="https://hello-github-ui.github.io/page/5/index.html">
<meta property="og:site_name" content="Lorem MoonのStory">
<meta property="og:description" content="即已成过往，便随它而去吧。">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://pic.imgdb.cn/item/6159d89b2ab3f51d91b0e8d0.jpg">
<meta property="article:author" content="Lorem Moon">
<meta property="article:tag" content="Hexo, blog, Lorem Moon, github page">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic.imgdb.cn/item/6159d89b2ab3f51d91b0e8d0.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://hello-github-ui.github.io/page/5/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: {"appId":"D5QZVMNT9K","apiKey":"92de0b03da46fa778c95817524081160","indexName":"hexo-blog","hits":{"per_page":100},"languages":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}.","hits_stats":"${hits} results found in ${time} ms"}},
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: {"limitDay":365,"position":"top","messagePrev":"It has been","messageNext":"days since the last update, the content of the article may be outdated."},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: 'days',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Lorem MoonのStory',
  isPost: false,
  isHome: true,
  isHighlightShrink: true,
  isToc: false,
  postUpdate: '2022-03-08 20:35:16'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://pic.imgdb.cn/item/6159d89b2ab3f51d91b0e8d0.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">60</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">Tags</div><div class="length-num">46</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">Categories</div><div class="length-num">5</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/musics/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://pic.imgdb.cn/item/604b7e335aedab222ce6194d.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Lorem MoonのStory</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> Search</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/musics/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">Lorem MoonのStory</h1><div id="site_social_icons"><a class="social-icon" href="https://github.com/hello-github-ui" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:util.you.come@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/posts/18315/" title="Spring AOP学习（一）"><img class="post_bg" src="https://pic.imgdb.cn/item/61210f024907e2d39c41cafb.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Spring AOP学习（一）"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/18315/" title="Spring AOP学习（一）">Spring AOP学习（一）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2021-03-26T21:57:21.000Z" title="Created 2021-03-27 05:57:21">2021-03-27</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/code/">code</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Java/">Java</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Spring-AOP/">Spring AOP</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/AOP/">AOP</a></span></div><div class="content">AOP简介来自于官方的定义：

Aspect-oriented Programming (AOP) complements Object-oriented Programming (OOP) by providing another way of thinking about program structure. The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect. Aspects enable the modularization of concerns that cut across multiple types and objects.

面向切面编程，是spring框架中的一个重要内容。利用 aop 可以对业务逻辑的各个部分进行隔离，从而使得业务逻辑各部分之间的耦合度降低，提高代码的可重用性，提高开发效率。
AOP一般用来实现以下几个功能：

日志记录，性能统计，安全控制，权限控制，事务处理，异常处理，资源池管理等

目前最受欢迎的 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/10968/" title="Java代码的执行顺序"><img class="post_bg" src="https://pic.imgdb.cn/item/612110284907e2d39c445567.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java代码的执行顺序"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/10968/" title="Java代码的执行顺序">Java代码的执行顺序</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2021-01-31T14:45:23.000Z" title="Created 2021-01-31 22:45:23">2021-01-31</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.570Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/code/">code</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Java/">Java</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/%E5%9F%BA%E7%A1%80/">基础</a></span></div><div class="content">Java 代码的执行顺序通过以下代码，更加快速地理解代码的执行顺序，以助于理解jvm的加载顺序，帮助我们在写代码时，写出更深刻的代码。
Sub 子类public class Sub &#123;    // 静态 不可变    private static final String str1 = &quot;00&quot;;    // 不可变    private final String str2 = &quot;01&quot;;    // 普通字符串    private String str3 = &quot;02&quot;;    // 静态 字符串    private static String str4 = &quot;03&quot;;    &#123;        System.out.println(&quot;Sub code block1 str1: &quot; + str1);        System.out.println(&quot;Sub code block1 str2: &quot; + str2);        System. ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/13813/" title="SpringBoot整合Redis"><img class="post_bg" src="https://img.imgdb.cn/item/604b93e95aedab222cf35159.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SpringBoot整合Redis"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/13813/" title="SpringBoot整合Redis">SpringBoot整合Redis</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-07-17T14:03:30.000Z" title="Created 2020-07-17 22:03:30">2020-07-17</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/code/">code</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Redis/">Redis</a></span></div><div class="content">Redis 简介基于内存进行存储，支持key-value的存储形式，底层是用C语言编写的
基于key-value形式的数据字典，结构非常简单，没有数据表的概念，直接用键值对的形式完成数据的管理，Redis支持5种数据类型：

字符串
列表
集合
有序集合
哈希

安装 Redis下载https://redis.io/download
解压，并在本地硬盘任意位置创建文件夹，在其中创建3个子文件夹
bin：放置启动 redis 的可执行文件
db：放置数据文件
etc：放置配置文件，设置redis服务的端口、日志文件位置、数据文件位置等

同时将解压后（或者安装后的所有文件）都拷贝到创建的这个文件夹下面

启动redis服务打开终端，进入到上一步新建的目录下面
先启动server：
./redis-server.exe ./redis.windows.conf

当然你也可以将server 注册为一个服务，但是我不建议这样做
再启动 client：
./redis-cli.exe

对数据进行操作：
set key valueget key

退出client：shutdown
Sprin ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/42943/" title="使用Python的you-get下载视频"><img class="post_bg" src="https://img.imgdb.cn/item/604ba03b5aedab222cf8ce1d.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="使用Python的you-get下载视频"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/42943/" title="使用Python的you-get下载视频">使用Python的you-get下载视频</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-07-13T04:06:12.000Z" title="Created 2020-07-13 12:06:12">2020-07-13</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Python/">Python</a></span></div><div class="content">You-get 介绍You-get是GitHub上的一个项目，也可以说是一个命令行程序，帮助大家下载大多主流网站上的视频、图片及音频。 支持的网站非常多，我们可以先来看一部分：



Site
URL
Videos?
Images?
Audios?




YouTube
https://www.youtube.com/
✓




Twitter
https://twitter.com/
✓
✓



VK
http://vk.com/
✓
✓



Vine
https://vine.co/
✓




Vimeo
https://vimeo.com/
✓




Veoh
http://www.veoh.com/
✓




Tumblr
https://www.tumblr.com/
✓
✓
✓


TED
http://www.ted.com/
✓




SoundCloud
https://soundcloud.com/


✓


SHOWROOM
https://www.showroom-live.com/
✓




Pinterest
https://www.pi ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/15501/" title="面试题泛谈"><img class="post_bg" src="https://pic.imgdb.cn/item/61210e2b4907e2d39c3ff679.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试题泛谈"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/15501/" title="面试题泛谈">面试题泛谈</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">Sticky</span><span class="article-meta__separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-07-07T08:50:08.000Z" title="Created 2020-07-07 16:50:08">2020-07-07</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/code/">code</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/categories/code/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E9%9D%A2%E8%AF%95/">面试</a></span></div><div class="content">在程序员的1-3年阶段，我们需要不断努力的学习并积累知识点，那么每个阶段都需要具备什么条件呢？请看下面：
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
10k面试题1.抽象类和接口的关系和区别，以及你在实际开发过程中是怎样使用的？
抽象类

概念：抽象类不能创建实例，它只能作为父类被继承。抽象类是从多个具体类中抽象出来的父类，它具有更高层次的抽象。从多个具有相同特征的类中抽象出一个抽象类，以这个抽象类作为其子类的模板，从而避免了子类的随意性。
特点：
抽象类无法被实例化（因为它不是具体的类，但是有构造方法）抽象类有构造方法，是给子类创建对象的抽象类中可以定义抽象方法（在方法的修饰列表中添加abstract关键字，并且以“;”结束，不能带有“{}”）public abstract void m1();抽象类中不一定有抽象方法，抽象方法一定在抽象类中一个非抽象类继承抽象类，必须将抽象类中的抽象方法覆盖，实现，重写抽象类的成员特点：1）成员变量：既可以是变量也可以是常量。2）构造方法：有构造方法，用于子类访问父类数据的初始化。3）成员方法：抽象类中方法既可以是抽象的，也可以是 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/7204/" title="Git-commit-中添加表情"><img class="post_bg" src="https://img.imgdb.cn/item/604b88595aedab222cebe8a4.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Git-commit-中添加表情"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/7204/" title="Git-commit-中添加表情">Git-commit-中添加表情</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-06-23T01:23:43.000Z" title="Created 2020-06-23 09:23:43">2020-06-23</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.570Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Git/">Git</a></span></div><div class="content">git commit 中使用表情我们经常可以在github上看到国外大佬的commit信息中有很多可爱的表情，这是怎么做到的呢？ok，可以这样使用哦：git commit -m &#39;提交信息 :emoji:&#39;，示例：git commit -m &#39;增加新功能 :sparkles:&#39;
有哪些表情呢来了，请参照这个链接：https://gitmoji.carloscuesta.me/
demo
gitmoji
emoji-cheat-sheet
full-emoji-list

</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/56937/" title="驾校一角"><img class="post_bg" src="https://img.imgdb.cn/item/604ba09f5aedab222cf8f6cc.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="驾校一角"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/56937/" title="驾校一角">驾校一角</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">Sticky</span><span class="article-meta__separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-06-22T17:34:43.000Z" title="Created 2020-06-23 01:34:43">2020-06-23</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E7%94%9F%E6%B4%BB/">生活</a></span></div><div class="content">经过一个多月的苦练，科目一二终于于昨天(2020-06-22)考过了，好累呀来看看我们驾校一角吧：
科目二考了两次，第一次直接灭火三次挂了，还好第二次机会满分通过啦哈哈哈
</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/54309/" title="SpringBoot-Vue-demo-02"><img class="post_bg" src="https://pic.imgdb.cn/item/612110704907e2d39c44f884.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SpringBoot-Vue-demo-02"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/54309/" title="SpringBoot-Vue-demo-02">SpringBoot-Vue-demo-02</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-06-16T14:16:15.000Z" title="Created 2020-06-16 22:16:15">2020-06-16</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/code/">code</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/SpringBoot/">SpringBoot</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Vue/">Vue</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/ElementUI/">ElementUI</a></span></div><div class="content">Vue + Element UI先在上一期的文章基础上引入 element-ui 依赖
添加 Element-UI依赖yarn add element-ui
在 main.js 中注册组件，并使用
选择引入布局
选择一个你喜欢的布局，然后粘贴代码到你的 App.vue 文件中（放入你想要的目标文件中即可）

启动前端项目，浏览器查看效果

现在呐，我们的菜单是写死的，并不符合我们的实际需求，因此我们需要修改为动态加载菜单
使用 Vue-router来动态构建左侧菜单先来创建几个示例页面
这时我们来访问页面，会发现有个问题



当我们的访问路径是：http://localhost:8080/pageTwo 或者 http://localhost:8080/pageOne 时是没有问题的，但是当是 http://localhost:8080/ 时会出现嵌套页面App.vue
这是我们需要解决的地方
那么怎么解决这个问题呢？首先我们需要来分析一下 App.vue 文件
router-view 分析我们当前的 应用程序是 spa 应用，原理就是在于这个 router-view。而这个和我们的 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/54629/" title="SpringBoot-Vue-demo-01"><img class="post_bg" src="https://pic.imgdb.cn/item/612110704907e2d39c44f884.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SpringBoot-Vue-demo-01"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/54629/" title="SpringBoot-Vue-demo-01">SpringBoot-Vue-demo-01</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-06-14T15:39:28.000Z" title="Created 2020-06-14 23:39:28">2020-06-14</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/code/">code</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/SpringBoot/">SpringBoot</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Vue/">Vue</a></span></div><div class="content">新建Vue3前端项目先删除之前的vue2版本npm uninstall -g vue-cli
安装新的vue cli 包npm install -g @vue/cli
安装完成后使用命令：vue -V 检查是否安装成功
构建项目这里我们使用 vue3 提供的图形化界面操作：
打开 cmder，输入 vue  ui


默认操作即可了
安装依赖yarn 
单页面spa应用
启动项目yarn run serve
单独运行成功，可以在  /src/views/ 自己再编写一个 Book.vue 页面，然后在 /src/router/index.js 中进行注册，使用即可
&lt;template&gt;    &lt;div&gt;        &lt;table&gt;            &lt;tr&gt;                &lt;td&gt;编号&lt;/td&gt;                &lt;td&gt;封面url&lt;/td&gt;                &lt;td&gt;书名&lt;/td&gt;                &lt; ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/9878/" title="Ubuntu 安装 Redis"><img class="post_bg" src="https://pic.imgdb.cn/item/612110b04907e2d39c458a3a.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Ubuntu 安装 Redis"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/9878/" title="Ubuntu 安装 Redis">Ubuntu 安装 Redis</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-03-22T12:57:52.000Z" title="Created 2020-03-22 20:57:52">2020-03-22</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/code/">code</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Redis/">Redis</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Ubuntu/">Ubuntu</a></span></div><div class="content">redis是什么Redis是常用基于内存的Key-Value数据库，比Memcache更先进，支持多种数据结构，高效，快速。用Redis可以很轻松解决高并发的数据访问问题
环境Ubuntu18.04
准备工作sudo apt update
安装使用 apt 从官方 Ubuntu 存储库来安装 Redis：sudo apt-get install redis-server
设置密码
首先打开Redis配置文件redis.confsudo vi /etc/redis/redis.conf
找到# requirepass foobared这一行，将注释符号#去掉，将后面修改成自己的密码，例如，设置密码为123456requirepass 123456

开启远程访问默认情况下，Redis服务器不允许远程访问，只允许本机访问，所以我们需要设置打开远程访问的功能。

打开Redis服务器的配置文件redis.confsudo vi /etc/redis/redis.conf
使用注释符号#注释bind 127.0.0.1这行#注释bind#bind 127.0.0.1

Redis服务控制sud ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/page/4/#content-inner"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/4/#content-inner">4</a><span class="page-number current">5</span><a class="page-number" href="/page/6/#content-inner">6</a><a class="extend next" rel="next" href="/page/6/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://pic.imgdb.cn/item/6159d89b2ab3f51d91b0e8d0.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Lorem Moon</div><div class="author-info__description">即已成过往，便随它而去吧。</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">60</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">Tags</div><div class="length-num">46</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">Categories</div><div class="length-num">5</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/hello-github-ui" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:util.you.come@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>Announcement</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Post</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/4723/" title="Redis主从搭建"><img src="https://pic.imgdb.cn/item/61210fda4907e2d39c439d0c.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Redis主从搭建"/></a><div class="content"><a class="title" href="/posts/4723/" title="Redis主从搭建">Redis主从搭建</a><time datetime="2022-03-08T12:34:42.574Z" title="Created 2022-03-08 20:34:42">2022-03-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/43818/" title="Win10开启上帝模式"><img src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Win10开启上帝模式"/></a><div class="content"><a class="title" href="/posts/43818/" title="Win10开启上帝模式">Win10开启上帝模式</a><time datetime="2022-03-08T12:24:42.000Z" title="Created 2022-03-08 20:24:42">2022-03-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/55966/" title="Ubuntu修改静态IP"><img src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Ubuntu修改静态IP"/></a><div class="content"><a class="title" href="/posts/55966/" title="Ubuntu修改静态IP">Ubuntu修改静态IP</a><time datetime="2022-03-04T16:11:25.000Z" title="Created 2022-03-05 00:11:25">2022-03-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/42154/" title="Java封装同步锁"><img src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java封装同步锁"/></a><div class="content"><a class="title" href="/posts/42154/" title="Java封装同步锁">Java封装同步锁</a><time datetime="2022-03-02T12:50:01.000Z" title="Created 2022-03-02 20:50:01">2022-03-02</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/1553/" title="初识大数据(一)"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg3.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="初识大数据(一)"/></a><div class="content"><a class="title" href="/posts/1553/" title="初识大数据(一)">初识大数据(一)</a><time datetime="2022-03-01T07:53:43.000Z" title="Created 2022-03-01 15:53:43">2022-03-01</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-comment-dots"></i><span>Newest Comments</span></div><div class="aside-list"><span>loading...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>Categories</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/code/"><span class="card-category-list-name">code</span><span class="card-category-list-count">35</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/code/%E8%AE%B0%E4%BA%8B%E6%9C%AC/"><span class="card-category-list-name">记事本</span><span class="card-category-list-count">2</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E7%AC%94%E8%AE%B0/"><span class="card-category-list-name">笔记</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/"><span class="card-category-list-name">记事本</span><span class="card-category-list-count">21</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E9%9A%8F%E7%AC%94/"><span class="card-category-list-name">随笔</span><span class="card-category-list-count">3</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>Tags</span></div><div class="card-tag-cloud"><a href="/tags/Java/" style="font-size: 1.45em; color: rgb(103, 132, 74)">Java</a><a href="/tags/CSS/" style="font-size: 1.15em; color: rgb(113, 157, 110)">CSS</a><a href="/tags/HTML/" style="font-size: 1.15em; color: rgb(156, 7, 166)">HTML</a><a href="/tags/MySQL/" style="font-size: 1.33em; color: rgb(18, 102, 115)">MySQL</a><a href="/tags/Centos7/" style="font-size: 1.15em; color: rgb(187, 111, 119)">Centos7</a><a href="/tags/Centos/" style="font-size: 1.21em; color: rgb(64, 200, 39)">Centos</a><a href="/tags/Redis/" style="font-size: 1.39em; color: rgb(27, 51, 36)">Redis</a><a href="/tags/%E5%9F%BA%E7%A1%80/" style="font-size: 1.33em; color: rgb(183, 93, 67)">基础</a><a href="/tags/%E7%AC%94%E8%AE%B0/" style="font-size: 1.15em; color: rgb(125, 78, 68)">笔记</a><a href="/tags/ElasticSearch/" style="font-size: 1.15em; color: rgb(50, 121, 127)">ElasticSearch</a><a href="/tags/%E6%95%B0%E6%8D%AE/" style="font-size: 1.15em; color: rgb(120, 11, 124)">数据</a><a href="/tags/Flink/" style="font-size: 1.15em; color: rgb(6, 199, 193)">Flink</a><a href="/tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/" style="font-size: 1.15em; color: rgb(134, 169, 154)">大数据</a><a href="/tags/Git/" style="font-size: 1.21em; color: rgb(102, 140, 50)">Git</a><a href="/tags/GitHub/" style="font-size: 1.15em; color: rgb(70, 53, 165)">GitHub</a><a href="/tags/%E8%A7%86%E9%A2%91/" style="font-size: 1.15em; color: rgb(19, 140, 107)">视频</a><a href="/tags/%E5%B7%A5%E5%85%B7/" style="font-size: 1.27em; color: rgb(62, 19, 79)">工具</a><a href="/tags/Excel/" style="font-size: 1.15em; color: rgb(10, 96, 84)">Excel</a><a href="/tags/Linux/" style="font-size: 1.33em; color: rgb(45, 17, 200)">Linux</a><a href="/tags/Mint/" style="font-size: 1.15em; color: rgb(83, 41, 97)">Mint</a><a href="/tags/Socket/" style="font-size: 1.21em; color: rgb(193, 93, 181)">Socket</a><a href="/tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" style="font-size: 1.21em; color: rgb(119, 163, 65)">网络编程</a><a href="/tags/Spring-AOP/" style="font-size: 1.21em; color: rgb(8, 137, 29)">Spring AOP</a><a href="/tags/AOP/" style="font-size: 1.27em; color: rgb(22, 47, 23)">AOP</a><a href="/tags/SpringBoot/" style="font-size: 1.33em; color: rgb(113, 125, 83)">SpringBoot</a><a href="/tags/Logback/" style="font-size: 1.15em; color: rgb(163, 113, 57)">Logback</a><a href="/tags/Tomcat/" style="font-size: 1.21em; color: rgb(141, 50, 119)">Tomcat</a><a href="/tags/Ubuntu/" style="font-size: 1.21em; color: rgb(144, 165, 15)">Ubuntu</a><a href="/tags/VMWare/" style="font-size: 1.15em; color: rgb(160, 158, 187)">VMWare</a><a href="/tags/Vim/" style="font-size: 1.15em; color: rgb(21, 81, 81)">Vim</a><a href="/tags/Windows/" style="font-size: 1.15em; color: rgb(170, 54, 45)">Windows</a><a href="/tags/WSL/" style="font-size: 1.15em; color: rgb(3, 127, 152)">WSL</a><a href="/tags/Vue/" style="font-size: 1.21em; color: rgb(12, 17, 57)">Vue</a><a href="/tags/ElementUI/" style="font-size: 1.15em; color: rgb(128, 64, 185)">ElementUI</a><a href="/tags/%E7%94%9F%E6%B4%BB/" style="font-size: 1.21em; color: rgb(195, 168, 103)">生活</a><a href="/tags/Python/" style="font-size: 1.15em; color: rgb(152, 145, 48)">Python</a><a href="/tags/%E5%BC%82%E5%B8%B8/" style="font-size: 1.15em; color: rgb(68, 147, 176)">异常</a><a href="/tags/ControllerAdvice/" style="font-size: 1.15em; color: rgb(110, 160, 7)">@ControllerAdvice</a><a href="/tags/RocketMQ/" style="font-size: 1.33em; color: rgb(192, 124, 146)">RocketMQ</a><a href="/tags/Hadoop/" style="font-size: 1.15em; color: rgb(139, 139, 140)">Hadoop</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>Archives</span><a class="card-more-btn" href="/archives/" title="More">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/03/"><span class="card-archive-list-date">March 2022</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/02/"><span class="card-archive-list-date">February 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/01/"><span class="card-archive-list-date">January 2022</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/12/"><span class="card-archive-list-date">December 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/11/"><span class="card-archive-list-date">November 2021</span><span class="card-archive-list-count">10</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/10/"><span class="card-archive-list-date">October 2021</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/09/"><span class="card-archive-list-date">September 2021</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/08/"><span class="card-archive-list-date">August 2021</span><span class="card-archive-list-count">2</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>Info</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">Article :</div><div class="item-count">60</div></div><div class="webinfo-item"><div class="item-name">Run time :</div><div class="item-count" id="runtimeshow" data-publishDate="2017-07-01T00:00:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">Total Count :</div><div class="item-count">127.5k</div></div><div class="webinfo-item"><div class="item-name">UV :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">PV :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">Last Push :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-03-08T12:35:15.995Z"></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://pic.imgdb.cn/item/604b7e335aedab222ce6194d.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2017 - 2022 By Lorem Moon</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my <a target="_blank" rel="noopener" href="https://hello-blogger-ui.blogspot.com/">google blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="Back To Top"><i class="fas fa-arrow-up"></i></button></div></div><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">Algolia</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><hr/><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-stats"></div></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="https://cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js"></script><script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4/dist/instantsearch.production.min.js"></script><script src="/js/search/algolia.js"></script><div class="js-pjax"></div><script src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.17.0/js/md5.min.js"></script><script>window.addEventListener('load', () => {
  const changeContent = (content) => {
    if (content === '') return content

    content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[image]') // replace image link
    content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[link]') // replace url
    content = content.replace(/<pre><code>.*?<\/pre>/gi, '[code]') // replace code
    content = content.replace(/<[^>]+>/g,"") // remove html tag

    if (content.length > 150) {
      content = content.substring(0,150) + '...'
    }
    return content
  }

  const getIcon = (icon, mail) => {
    if (icon) return icon
    let defaultIcon = '?d=monsterid'
    let iconUrl = `https://gravatar.loli.net/avatar/${md5(mail.toLowerCase()) + defaultIcon}`
    return iconUrl
  }

  const generateHtml = array => {
    let result = ''

    if (array.length) {
      for (let i = 0; i < array.length; i++) {
        result += '<div class=\'aside-list-item\'>'

        if (true) {
          const name = 'src'
          result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
        }

        result += `<div class='content'>
        <a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
        <div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
        </div></div>`
      }
    } else {
      result += 'No Comment'
    }

    let $dom = document.querySelector('#card-newest-comments .aside-list')
    $dom.innerHTML= result
    window.lazyLoadInstance && window.lazyLoadInstance.update()
    window.pjax && window.pjax.refresh($dom)
  }

  const getComment = () => {
    const serverURL = 'https://mFM6i90b.api.lncldglobal.com'

    var settings = {
      "method": "GET",
      "headers": {
        "X-LC-Id": 'mFM6i90bN6KqyTH6tmC3q7dz-gzGzoHsz',
        "X-LC-Key": 'T2tsKoiKjMaB0wgtIAgSz6Ul',
        "Content-Type": "application/json"
      },
    }

    fetch(`${serverURL}/1.1/classes/Comment?limit=6&order=-createdAt`,settings)
      .then(response => response.json())
      .then(data => {
        const valineArray = data.results.map(function (e) {
          return {
            'avatar': getIcon(e.QQAvatar, e.mail),
            'content': changeContent(e.comment),
            'nick': e.nick,
            'url': e.url + '#' + e.objectId,
            'date': e.updatedAt,
          }
        })
        saveToLocal.set('valine-newest-comments', JSON.stringify(valineArray), 10/(60*24))
        generateHtml(valineArray)
      }).catch(e => {
        const $dom = document.querySelector('#card-newest-comments .aside-list')
        $dom.innerHTML= "Unable to get the data, please make sure the settings are correct."
      }) 
  }

  const newestCommentInit = () => {
    if (document.querySelector('#card-newest-comments .aside-list')) {
      const data = saveToLocal.get('valine-newest-comments')
      if (data) {
        generateHtml(JSON.parse(data))
      } else {
        getComment()
      }
    }
  }

  newestCommentInit()
  document.addEventListener('pjax:complete', newestCommentInit)
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>